@model IEnumerable<ShivamEMR.Model.Domain.PatientDomain.Admission>

@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table cellspacing="10">
    <tr>
        <th></th>
        <th>
            Admission At
        </th>
      @*  <th>
            ReferrerNotes
        </th>
        <th>
            Notes
        </th>
        <th>
            DischargeDateAndTime
        </th>*@
        <th>
            Admission Type
        </th>
        <th>
            Patient
        </th>
        <th>
            ReferredBy
        </th>
        <th>
            Status
        </th>
       @* <th>
            Insurances
        </th>
        <th>
            Representatives
        </th>
        <th>
            Assignments
        </th>
        <th>
            Informations
        </th>
        <th>
            Diagnosises
        </th>
        <th>
            Tests
        </th>
        <th>
            Services
        </th>
        <th>
            Radiologies
        </th>*@
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.ID }) |
            @Html.ActionLink("Details", "Details", new { id=item.ID }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.ID })
        </td>
        <td>
			@String.Format("{0:g}", item.AdmissionDateAndTime)
        </td>
       @* <td>
			@item.ReferrerNotes
        </td>
        <td>
			@item.Notes
        </td>
        <td>
			@String.Format("{0:g}", item.DischargeDateAndTime)
        </td>*@
        <td>
			@Html.DisplayTextFor(_ => item.AdmissionType.Type).ToString()
        </td>
        <td>
			@(item.Patient == null ? "None" : item.Patient.FullName)
        </td>
        <td>
			@(item.ReferredBy == null ? "None" : item.ReferredBy.FullName)
        </td>
        <td>
			@Html.DisplayTextFor(_ => item.Status.Status).ToString()
        </td>
       @* <td>
			@(item.Insurances == null ? "None" : item.Insurances.Count.ToString())
        </td>
        <td>
			@(item.Representatives == null ? "None" : item.Representatives.Count.ToString())
        </td>
        <td>
			@(item.Assignments == null ? "None" : item.Assignments.Count.ToString())
        </td>
        <td>
			@(item.Informations == null ? "None" : item.Informations.Count.ToString())
        </td>
        <td>
			@(item.Diagnosises == null ? "None" : item.Diagnosises.Count.ToString())
        </td>
        <td>
			@(item.Tests == null ? "None" : item.Tests.Count.ToString())
        </td>
        <td>
			@(item.Services == null ? "None" : item.Services.Count.ToString())
        </td>
        <td>
			@(item.Radiologies == null ? "None" : item.Radiologies.Count.ToString())
        </td>*@
    </tr>
}

</table>


